
#include "ImageLoading.h"

// Using OpenIL ( http://openil.sourceforge.net/ ) to load the images for the
// textures. The new version is called DevIL (in the same website).
#include <IL/il.h>
#include <IL/ilu.h>
#include <IL/ilut.h>

//#include <stdexcept>
#include <iostream>
#include <string>

#include <windows.h>
#include <gl/gl.h>

ImageLoading::ImageLoading(void)
{
	// Initializing the DevIL engine
	ilInit();
	iluInit();
	ilutRenderer(ILUT_OPENGL);
}

ImageLoading::~ImageLoading(void)
{
}

GLuint ImageLoading::loadImageForTexture(const char * filename)
{
	char * name = (char *)malloc(50);
	strcpy(name, filename);
	return ilutGLLoadImage(name);
	free(name);
}
